home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / sun3src / m68vectors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-13  |  3.2 KB  |  120 lines

  1.  
  2. /*    @(#)m68vectors.h 1.1 86/09/27 SMI    */
  3.  
  4. /*
  5.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  6.  */
  7.  
  8. /*
  9.  * m68vectors.h
  10.  *
  11.  * Defines MC68000/10/20 exception vectors and interrupt handling.
  12.  *
  13.  * To set an interrupt vector, you should use the set_evec routine
  14.  * declared below.  Direct access to vectors from C code is discouraged,
  15.  * since it's hard to take the Vector Base Reg into account.
  16.  */
  17.  
  18. /*
  19.  * int (*)()
  20.  * set_evec(offset, func)
  21.  *     int offset;        /* Offset to vector, eg 8 for berr
  22.  *     int (*func)();        /* Function to call for it
  23.  *
  24.  * Sets the vector at  offset  to  func  and returns the previous value.
  25.  */
  26. int (*set_evec())();
  27.  
  28. #define    EVEC_RESET    0x000
  29. #define    EVEC_BUSERR    0x008
  30. #define    EVEC_ADDERR    0x00C
  31. #define    EVEC_ILLINST    0x010
  32. #define    EVEC_DIVZERO    0x014
  33. #define    EVEC_CHK    0x018
  34. #define    EVEC_TRAPV    0x01C
  35. #define    EVEC_PRIV    0x020
  36. #define    EVEC_TRACE    0x024
  37. #define    EVEC_LINE1010    0x028
  38. #define    EVEC_LINE1111    0x02C
  39. /*            0x030 */
  40. #define    EVEC_COPROC    0x034
  41. #define    EVEC_FORMAT    0x038
  42. #define    EVEC_UNINITINT    0x03C
  43. #define    EVEC_BOOT_EXEC    0x04
  44. #define    EVEC_MENU_TSTS    0x05
  45. /*
  46.  * vectors 0x40 - 0x5C are "reserved to Motorola")
  47.  */
  48.  
  49. #define    EVEC_SPURINT    0x060
  50. #define    EVEC_LEVEL1    0x064
  51. #define    EVEC_LEVEL2    0x068
  52. #define    EVEC_LEVEL3    0x06C
  53. #define    EVEC_LEVEL4    0x070
  54. #define    EVEC_LEVEL5    0x074
  55. #define    EVEC_LEVEL6    0x078
  56. #define    EVEC_LEVEL7    0x07C
  57.  
  58. #define    EVEC_TRAP0    0x080
  59. #define    EVEC_TRAP1    0x084
  60. #define    EVEC_TRAP2    0x088
  61. #define    EVEC_TRAP3    0x08C
  62. #define    EVEC_TRAP4    0x090
  63. #define    EVEC_TRAP5    0x094
  64. #define    EVEC_TRAP6    0x098
  65. #define    EVEC_TRAP7    0x09C
  66. #define    EVEC_TRAP8    0x0A0
  67. #define    EVEC_TRAP9    0x0A4
  68. #define    EVEC_TRAPA    0x0A8
  69. #define    EVEC_TRAPB    0x0AC
  70. #define    EVEC_TRAPC    0x0B0
  71. #define    EVEC_TRAPD    0x0B4
  72. #define    EVEC_TRAPE    0x0B8
  73. #define    EVEC_TRAPF    0x0BC
  74.  
  75. /*
  76.  * vectors 0xC0 - 0xFC are "reserved to Motorola"
  77.  */
  78.  
  79. /*
  80.  * vectors 0x100 - 0x3FC are User Interrupt Vectors for I/O
  81.  */
  82.  
  83. #define    EVEC_LASTVEC    0x3FC
  84. #define    EVEC_AFTER    0x400
  85. #define    NUM_EVECS    256    /* number of exception vectors */
  86.  
  87.  
  88. /*
  89.  * Fake exception vector addresses used as "vector offset" values
  90.  * when simulating interrupts (eg K command).
  91.  */
  92. #define    EVEC_KCMD    0x001    /* K1 command causing reset */
  93. #define    EVEC_BOOTING    0x002    /* B command causing reset */
  94. #define    EVEC_DOG    0x003    /* Watchdog reset, not power-on */
  95. #define    EVEC_ABORT    0x07D    /* Abort from keyboard NMI */
  96. #define    EVEC_MEMERR    0x07E    /* Memory error NMI */
  97.  
  98. /*
  99.  * Define the information stacked by the CPU on a trap.
  100.  *
  101.  * (Much more info is stacked on a Bus Error or Address Error.
  102.  *  See ../h/buserr.h for a complete description.)
  103.  */
  104. struct intstack {
  105.     short    i_sr;        /* Stacked status register */
  106.     long    i_pc;        /* Program counter of error */
  107.     short    i_fvo;        /* Format & vector offset */
  108. };
  109.  
  110. #define    FVO_FORMAT    0xF000    /* Stack format portion of FVO */
  111. #define    FVO_OFFSET    0x0FFF    /* Vector offset portion of FVO */
  112.  
  113. #define    FVO_FORMAT_NORMAL    0x0000    /*  8 byte normal frame */
  114. #define    FVO_FORMAT_THROWAWAY    0x1000    /*  8 byte throwaway frame */
  115. #define    FVO_FORMAT_WITH_OLDPC    0x2000    /* 12 byte frame with PC of instruc */
  116. #define    FVO_FORMAT_68010_BERR    0x8000    /* 58 byte 68010 bus error frame */
  117. #define    FVO_FORMAT_COPROC_MID    0x9000    /* 20 byte coproc mid-instr frame */
  118. #define    FVO_FORMAT_SHORT_BERR    0xA000    /* 32 byte 68020 bus error frame */
  119. #define    FVO_FORMAT_LONG_BERR    0xB000    /* 0x5C byte 68020 bus error frame */
  120.